package com.example.demo.api;

/**
 * @author Shanks
 * @date 2020-03-28
 */
public class ApiException extends RuntimeException {

    private static final long serialVersionUID = -6428923835382198919L;

    private ErrorCode errorCode;

    public ApiException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }
}